<%@page import="com.xhd.vo.Order"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.xhd.vo.Fruits"%>
<%@page import="java.util.List"%>
<%@page import="com.xhd.Dao.SalerDaoImpl"%>
<%@page import="com.xhd.Dao.SalerDao"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:if test="${ not empty sessionScope.user}">
	<%
	SalerDao sd = new SalerDaoImpl();
	List<Order> orderlist=sd.showOrder();
	Iterator<Order> oIter=orderlist.iterator();
	if (!oIter.hasNext()){
	%>	
		暂无订单！<br>
		<a href="SalerMenu.jsp">点击此处</a>返回卖家主页
	<%	
	}
	else {
		Order order=null;
		while(oIter.hasNext()){
			order=oIter.next();
	%>
	

    买家：<%=order.getOrder_buyer() %>||
    手机：<%=order.getOrder_phone() %> ||
    地址：<%=order.getOrder_address()%>||
    水果：<%=order.getOrder_fruit()%>||
    状态：<%=order.getOrder_state() %>
    <%
    if (order.getOrder_state().equals("待处理")){
    %>
    ||<a href="OrderSuccess.jsp?fruit=<%=order.getOrder_fruit() %>">交易成功</a>||
    <a href="OrderFail.jsp?fruit=<%=order.getOrder_fruit() %>">取消交易</a>
    <%	
    } 
    %>
    <br/>
	<%	
		}
	%>
	    <a href="SalerMenu.jsp">返回卖家主页</a>
	<%
	}
	%>
</c:if>
<c:if test="${  empty sessionScope.user}">
<h1>你还未登录！</h1>
<a href="SalerLogin.jsp">点击登录</a>
</c:if>
</body>
</html>